local Lua__fanqie = fk.CreateSkill {

  name = "Lua__fanqie",

  tags = { Skill.Compulsory, },

}

Fk:loadTranslationTable{
    
    ["Lua__fanqie"] = "番茄",
    ["#Lua__fanqieECC"] = "番茄",
    [":Lua__fanqie"] = "锁定技，你的红色牌使用次数、目标数、结算次数、伤害、回复、点数均+1。",
}

Lua__fanqie:addEffect("filter", {
    card_filter = function(self, card, player,isJudgeEvent)
        return player:hasSkill(Lua__fanqie.name) and card.color == Card.Red and
        (table.contains(player:getCardIds("he"), card.id) or isJudgeEvent)
    end,
    view_as = function(self, player, to_select)
        return Fk:cloneCard(to_select.name, to_select.suit, to_select.number + 1)
    end,
})

Lua__fanqie:addEffect("targetmod", {
    residue_func = function(self, player, skill, scope, card)
        if card and player:hasSkill("Lua__fanqie") and card.color == Card.Red then
            return 1
        end
    end,
    extra_target_func = function(self, player, skill, card)
        if card and player:hasSkill("Lua__fanqie") and card.color == Card.Red then
            return 1
        end
    end,
})

Lua__fanqie:addEffect(fk.PreHpRecover, {
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(Lua__fanqie.name) and data.card and 
               data.recoverBy and data.recoverBy == player and data.card.color == Card.Red
    end,
    on_use = function(self, event, target, player, data)
        data:changeRecover(1)
    end,
})
Lua__fanqie:addEffect(fk.TargetSpecifying, {
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(Lua__fanqie.name) and
               data.card.color == Card.Red
    end,
    on_use = function(self, event, target, player, data)
        data.use.additionalEffect = 1
        data.additionalDamage = (data.additionalDamage or 0) + 1
    end,
})

return Lua__fanqie